﻿// Original author contact info: Owen Emlen (owene_1998@yahoo.com)
// Note: other individuals may also have contributed to this code
// Project hosted on CodePlex.com as of 1/10/2009 at http://www.codeplex.com/EmlenMud
using System;
using BrainTechLLC.ThreadSafeObjects;

namespace BrainTechLLC
{
	[Serializable, AttributeUsage(AttributeTargets.Method)]
	public class LogableAttribute : Attribute, IReadableAttribute
	{
		public string MessageType { get; set; }
		public string LogMessage { get; set; }
		public LogSeverity LogLevel { get; set; }
		public string MessageTypeAfter { get; set; }
		public string LogMessageAfter { get; set; }
		public LogSeverity LogLevelAfter { get; set; }
		public object Value { get { return LogLevel; } }

		public LogableAttribute(LogSeverity level, string messageType, string logMessage)
		{
			MessageType = messageType;
			LogLevel = level;
			LogMessage = logMessage;
		}

		public LogableAttribute(LogSeverity level, string messageType, string logMessage,
			LogSeverity levelAfter, string messageTypeAfter, string logMessageAfter)
		{
			MessageTypeAfter = messageTypeAfter;
			LogLevelAfter = levelAfter;
			LogMessageAfter = logMessageAfter;
			MessageType = messageType;
			LogLevel = level;
			LogMessage = logMessage;
		}
	}
}

